cc.Class({
    extends: cc.Component,

    properties: {
        _makeText: "",
        
        makeText: {
            get: function () {
                return this._makeText;
            },
            set: function (value) {
                this._makeText = value;
            },
        }
    },

    onLoad: function () {
        var toastbg_node = cc.find("toast_bg", this.node);
        toastbg_node.setContentSize(this._makeText.length * 25 + 20, toastbg_node.height);
        var toastlabel_node = cc.find("toast_bg/label_toast", this.node);
        toastlabel_node.getComponent(cc.Label).string = this._makeText;
        
        this.node.runAction(cc.sequence(
            cc.moveBy(1, cc.p(0, 50)),
            cc.callFunc(this.onCallfunc, this)
            ));
    },
    
    onCallfunc: function () {
        this.node.destroy();
    },
});
